assert_that(p.cargo_process("build"),
execs().with_status(0)
- .with_stdout(&format!("\
+ .with_stderr(&format!("\
[COMPILING] syntax v0.0.1 ({dir})
",
dir = p.url())));
assert_that(foo.cargo("build"),
execs().with_status(0)
- .with_stdout(&format!("\
+ .with_stderr(&format!("\
[COMPILING] foo v0.0.0 ({url})
", url = foo.url())));
assert_that(foo.cargo("build").env("FIRST", "1"),
execs().with_status(0)
- .with_stdout(&format!("\
+ .with_stderr(&format!("\
[COMPILING] foo v0.0.0 ({url})
", url = foo.url())));
File::create(&foo.root().join("src/bar.rs")).unwrap();
assert_that(foo.cargo("build"),
execs().with_status(0)
- .with_stdout(&format!("\
+ .with_stderr(&format!("\
[COMPILING] foo v0.0.0 ({url})
", url = foo.url())));
});
"#);
assert_that(p.cargo_process("build").arg("-v"),
execs().with_status(101)
- .with_stdout(&format!("\
+ .with_stderr(&format!("\
[COMPILING] foo v0.5.0 ({url})
[RUNNING] `rustc build.rs --crate-name build_script_build --crate-type bin [..]`
[RUNNING] `[..]build-script-build[..]`
// Now build!
assert_that(foo.cargo("build"),
execs().with_status(0)
- .with_stdout(&format!("\
+ .with_stderr(&format!("\
[UPDATING] git repository `{bar}`
[COMPILING] bar v0.0.0 ({bar}#[..])
[COMPILING] foo v0.0.0 ({foo})
// Generate a lockfile which did not use `bar` to compile, but had to update
// `bar` to generate the lockfile
assert_that(p.cargo_process("build"),
- execs().with_stdout(&format!("\
+ execs().with_stderr(&format!("\
[UPDATING] git repository `{bar}`
[COMPILING] foo v0.5.0 ({url})
", url = p.url(), bar = p2.url())));
assert_that(foo.cargo("build"),
execs().with_status(0)
- .with_stdout(&format!("\
+ .with_stderr(&format!("\
[COMPILING] foo v0.0.0 ({url})
", url = foo.url())));
// Generate a lockfile which did not use `bar` to compile, but had to update
// `bar` to generate the lockfile
assert_that(p.cargo_process("build"),
- execs().with_stdout(&format!("\
+ execs().with_stderr(&format!("\
[UPDATING] git repository `{bar}`
[COMPILING] foo v0.5.0 ({url})
", url = p.url(), bar = p2.url())));
p1.build();
p1.root().move_into_the_past().unwrap();
assert_that(p1.cargo("build"),
- execs().with_stdout(&format!("\
+ execs().with_stderr(&format!("\
[UPDATING] git repository `{bar}`
[COMPILING] [..]
[COMPILING] [..]
"#, bar.url()))
.file("src/main.rs", "fn main() {}");
assert_that(p2.cargo_process("build"),
- execs().with_stdout(&format!("\
+ execs().with_stderr(&format!("\
[UPDATING] git repository `{bar}`
[COMPILING] [..]
[COMPILING] [..]
"#, bar.url()))
.file("src/main.rs", "fn main() {}");
assert_that(p.cargo_process("fetch"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[UPDATING] git repository `{url}`
", url = bar.url())));
assert_that(p.cargo("update")
.arg("-p").arg("foo"),
execs().with_status(0)
- .with_stdout(&format!("\
+ .with_stderr(&format!("\
[UPDATING] git repository `{}`
", foo.url())));
});
p.build();
assert_that(p.cargo("build"),
execs().with_status(0)
- .with_stdout(&format!("\
+ .with_stderr(&format!("\
[UPDATING] git repository `{}`
[UPDATING] git repository `{}`
[COMPILING] transitive [..]
assert_that(p.cargo("build"),
execs().with_status(0)
- .with_stdout(&format!("\
+ .with_stderr(&format!("\
[UPDATING] git repository `{}`
[COMPILING] dep [..]
[COMPILING] project [..]
assert_that(p.cargo_process("build").arg("--target").arg(&target).arg("-v"),
execs().with_status(0)
- .with_stdout(&format!("\
+ .with_stderr(&format!("\
[COMPILING] foo v0.0.0 (file://[..])
[RUNNING] `rustc build.rs [..] --out-dir {dir}[..]target[..]build[..]foo-[..]`
[RUNNING] `{dir}[..]target[..]build[..]foo-[..]build-script-build`
assert_that(p.cargo_process("build").arg("-v").arg("--target").arg(&target),
execs().with_status(0)
- .with_stdout(&format!("\
+ .with_stderr(&format!("\
[COMPILING] d2 v0.0.0 ([..])
[RUNNING] `rustc d2[..]src[..]lib.rs [..]`
[COMPILING] d1 v0.0.0 ([..])
"#);
assert_that(p.cargo_process("doc"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[..] foo v0.0.1 ({dir})
[..] foo v0.0.1 ({dir})
",
"#);
assert_that(p.cargo_process("doc"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[DOCUMENTING] foo v0.0.1 ({dir})
",
dir = path2url(p.root()))));
"#);
assert_that(p.cargo_process("doc"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[..] bar v0.0.1 ({dir}/bar)
[..] bar v0.0.1 ({dir}/bar)
[DOCUMENTING] foo v0.0.1 ({dir})
"#);
assert_that(p.cargo_process("doc").arg("--no-deps"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[COMPILING] bar v0.0.1 ({dir}/bar)
[DOCUMENTING] foo v0.0.1 ({dir})
",
p.build();
assert_that(p.cargo("build").cwd(p.root().join("a1")),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[COMPILING] d v0.0.1 ({dir}/d)
[COMPILING] c v0.0.1 ({dir}/c)
[COMPILING] b v0.0.1 ({dir}/b)
[COMPILING] a1 v0.0.1 ({dir}/a1)
", dir = p.url())));
assert_that(p.cargo("build").cwd(p.root().join("a2")),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[COMPILING] a2 v0.0.1 ({dir}/a2)
", dir = p.url())));
});
pkg("foo", "0.0.1");
assert_that(cargo_process("install").arg("foo"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `[..]`
[DOWNLOADING] foo v0.0.1 (registry file://[..])
[COMPILING] foo v0.0.1 (registry file://[..])
assert_that(cargo_home(), has_installed_exe("foo"));
assert_that(cargo_process("uninstall").arg("foo"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[REMOVING] {home}[..]bin[..]foo[..]
",
home = cargo_home().display())));
pkg("foo", "0.0.2");
assert_that(cargo_process("install").arg("foo"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `[..]`
[DOWNLOADING] foo v0.0.2 (registry file://[..])
[COMPILING] foo v0.0.2 (registry file://[..])
p.build();
assert_that(cargo_process("install").arg("--force").arg("--path").arg(p.root()),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[COMPILING] foo v0.2.0 ([..])
[REPLACING] {home}[..]bin[..]foo[..]
",
p.build();
assert_that(cargo_process("install").arg("--force").arg("--path").arg(p.root()),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[COMPILING] foo v0.2.0 ([..])
[INSTALLING] {home}[..]bin[..]foo-bin3[..]
[REPLACING] {home}[..]bin[..]foo-bin2[..]
.arg("foo-bin2")
.arg("--path")
.arg(p.root()),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[COMPILING] foo v0.2.0 ([..])
[REPLACING] {home}[..]bin[..]foo-bin2[..]
",
p.build();
assert_that(cargo_process("install").arg("--git").arg(p.url().to_string()),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[UPDATING] git repository `[..]`
[COMPILING] foo v0.1.0 ([..])
[INSTALLING] {home}[..]bin[..]foo[..]
.file("src/bar.txt", ""); // should be ignored when packaging
assert_that(p.cargo_process("package"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[PACKAGING] foo v0.0.1 ({dir})
[VERIFYING] foo v0.0.1 ({dir})
[COMPILING] foo v0.0.1 ({dir}[..])
fn main() {}
"#);
assert_that(p.cargo_process("package"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[PACKAGING] foo v0.0.1 ({dir})
[VERIFYING] foo v0.0.1 ({dir})
[COMPILING] foo v0.0.1 ({dir}[..])
fn main() {}
"#);
assert_that(p.cargo_process("package"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[PACKAGING] foo v0.0.1 ({dir})
[VERIFYING] foo v0.0.1 ({dir})
[COMPILING] foo v0.0.1 ({dir}[..])
fn main() {}
"#);
assert_that(p.cargo_process("package"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[PACKAGING] foo v0.0.1 ({dir})
[VERIFYING] foo v0.0.1 ({dir})
[COMPILING] foo v0.0.1 ({dir}[..])
assert_that(p.cargo_process("build"),
execs().with_status(0));
assert_that(p.cargo("package"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[PACKAGING] foo v0.0.1 ({dir})
[VERIFYING] foo v0.0.1 ({dir})
[COMPILING] foo v0.0.1 ({dir}[..])
.file("a_dir/nested/src/main.rs", main_rs);
assert_that(p.cargo_process("package"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[PACKAGING] nested v0.0.1 ({dir})
[VERIFYING] nested v0.0.1 ({dir})
[COMPILING] nested v0.0.1 ({dir}[..])
.file("src/main.rs", "fn main() {}");
assert_that(p.cargo_process("publish").arg("--no-verify"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `{reg}`
[PACKAGING] foo v0.0.1 ({dir})
[UPLOADING] foo v0.0.1 ({dir})
Package::new("bar", "0.0.1").publish();
assert_that(p.cargo_process("build"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `{reg}`
[DOWNLOADING] bar v0.0.1 (registry file://[..])
[COMPILING] bar v0.0.1 (registry file://[..])
// Don't download a second time
assert_that(p.cargo_process("build"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `{reg}`
[..] bar v0.0.1 (registry file://[..])
[..] foo v0.0.1 ({dir})
Package::new("bar", "0.0.1").dep("baz", "*").publish();
assert_that(p.cargo_process("build"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `{reg}`
[DOWNLOADING] [..] v0.0.1 (registry file://[..])
[DOWNLOADING] [..] v0.0.1 (registry file://[..])
Package::new("notyet", "0.0.1").publish();
assert_that(p.cargo("build"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `{reg}`
[DOWNLOADING] notyet v0.0.1 (registry file://[..])
[COMPILING] notyet v0.0.1 (registry file://[..])
Package::new("bar", "0.0.1").publish();
assert_that(p.cargo("build"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `[..]`
[DOWNLOADING] bar v0.0.1 (registry file://[..])
[COMPILING] bar v0.0.1 (registry file://[..])
Package::new("bar", "0.0.1").dep("baz", "*").publish();
assert_that(p.cargo("build"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `[..]`
[DOWNLOADING] [..] v0.0.1 (registry file://[..])
[DOWNLOADING] [..] v0.0.1 (registry file://[..])
Package::new("bar", "0.0.2").dep("baz", "*").yanked(true).publish();
assert_that(p.cargo("build"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `[..]`
[DOWNLOADING] [..] v0.0.1 (registry file://[..])
[DOWNLOADING] [..] v0.0.1 (registry file://[..])
println!("0.0.2 build");
assert_that(p.cargo("build"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[DOWNLOADING] [..] v0.0.2 (registry file://[..])
[COMPILING] bar v0.0.2 (registry file://[..])
[COMPILING] foo v0.0.1 ({dir})
println!("0.0.3 build");
assert_that(p.cargo("build"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[DOWNLOADING] [..] v0.0.3 (registry file://[..])
[COMPILING] bar v0.0.3 (registry file://[..])
[COMPILING] foo v0.0.1 ({dir})
Package::new("bar", "0.0.1").dev_dep("baz", "*").publish();
assert_that(p.cargo("build"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `[..]`
[DOWNLOADING] [..] v0.0.1 (registry file://[..])
[COMPILING] bar v0.0.1 (registry file://[..])
Package::new("bar", "0.0.1").publish();
assert_that(p.cargo("build"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `[..]`
[DOWNLOADING] bar v0.0.1 (registry file://[..])
[COMPILING] bar v0.0.1 (registry file://[..])
println!("second");
assert_that(p.cargo("build"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `[..]`
[DOWNLOADING] bar v0.1.0 (registry file://[..])
[COMPILING] bar v0.1.0 (registry file://[..])
p.root().move_into_the_past().unwrap();
assert_that(p.cargo("build"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[UPDATING] [..]
[UPDATING] [..]
[DOWNLOADING] a v0.0.1 (registry file://[..])
fs::remove_dir_all(&p.root().join("target")).unwrap();
assert_that(p.cargo("build"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[UPDATING] [..]
[DOWNLOADING] a v0.1.1 (registry file://[..])
[COMPILING] a v0.1.1 (registry [..])
"#);
assert_that(p.cargo_process("run").arg("--release"),
- execs().with_status(0).with_stdout(&format!("\
+ execs().with_status(0).with_stderr(&format!("\
[COMPILING] foo v0.0.1 ({dir})
[RUNNING] `target{sep}release{sep}foo[..]`
",
assert_that(p.cargo_process("test").arg("--no-run"),
execs().with_status(0)
- .with_stdout(&format!("\
+ .with_stderr(&format!("\
[COMPILING] foo v0.0.1 ({dir})
",
dir = p.url())));
assert_that(p.cargo_process("test").arg("--").arg("--nocapture"),
execs().with_status(0)
- .with_stdout(&format!("\
+ .with_stderr(&format!("\
[COMPILING] foo v0.0.1 ({dir})
[RUNNING] target[..]bar-[..]
",
assert_that(p.cargo_process("test").arg("--no-run").arg("-v"),
execs().with_status(0)
- .with_stdout(&format!("\
+ .with_stderr(&format!("\
[COMPILING] foo v0.0.1 ({dir})
[RUNNING] `rustc [..]`
[RUNNING] `rustc [..]`
"#, target));
assert_that(foo.cargo_process("build").arg("--verbose"),
- execs().with_stdout(&format!("\
+ execs().with_stderr(&format!("\
[COMPILING] foo v0.0.1 ({url})
[RUNNING] `rustc [..] -C ar=nonexistent-ar -C linker=nonexistent-linker [..]`
", url = foo.url())))
};
assert_that(foo.cargo_process("build").arg("--verbose"),
- execs().with_stdout(&format!("\
+ execs().with_stderr(&format!("\
[COMPILING] foo v0.0.1 ({url})
[RUNNING] `rustc [..] -C ar={ar} -C linker={linker} [..]`
", url = foo.url(), ar = output.0, linker = output.1)))
};
assert_that(origin.cargo_process("build").cwd(foo_path).arg("--verbose"),
- execs().with_stdout(&format!("\
+ execs().with_stderr(&format!("\
[COMPILING] foo v0.0.1 ({url})
[RUNNING] `rustc [..] -C ar={ar} -C linker={linker} [..]`
", url = foo_url, ar = output.0, linker = output.1)))